package com.basketball.gym.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * <p>
 *
 * </p>
 *
 * @author 赵肖云
 * @since 2021-03-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "Price对象", description = "")
public class Price implements Serializable {
    public interface update {
    }

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateAt;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createAt;

    @ApiModelProperty(value = "价格")
    @NotNull(message = "price不能为空", groups = {update.class})
    private Double price;

    @ApiModelProperty(value = "价格类型ID(1为散客，2为包半场，3为包全场)")
    @Min(value = 1, message = "id只能是1，2，3", groups = {Calendar.update.class})
    @Max(value = 3, message = "id只能是1，2，3", groups = {Calendar.update.class})
    @NotNull(message = "id不能为空", groups = {update.class})
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


}
